package com.jiazhong.mingxing.boot.boot14.listener;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
@RocketMQMessageListener(consumerGroup = "abc1",topic = "TopicB",
        selectorExpression = "transaction1",messageModel = MessageModel.BROADCASTING)
public class StockListener implements RocketMQListener<String> {

    @Override
    public void onMessage(String s) {
        log.info("message:{}", s);
        log.info("开始更新库存");
    }
}
